﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;

namespace DateBaseSyshronous
{
    /// <summary>
    /// 从数据库的xml文件分析
    /// </summary>
    public class SlaveModel : SqlModel
    {
        public SlaveModel() : base() {
        }

        public SlaveModel(XmlNode node) : base(node) {
        }

        public static List<SlaveModel> GetSlaveModels(string path) {
            List<SlaveModel> list = new List<SlaveModel>();
            if (File.Exists(path)) {
                XmlDocument doc = XmlHelper.GetXmlDoument(path);
                XmlNode xn = doc.SelectSingleNode("SlaveDataBase");
                XmlNodeList xnl = xn.ChildNodes;
                foreach (XmlNode node in xnl) {
                    list.Add(new SlaveModel(node));
                }
            }
            return list;
        }

        public override string RegularString(string value) {
            return base.RegularString(value);
        }

    }
}
